package cn.gcjxsc.payment.config;

import cn.gcjxsc.payment.data.*;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author pumbaa
 * @since 1.0
 */
@Configuration
public class WxConfig {

    @Bean
    @RefreshScope
    @ConfigurationProperties(prefix = "wx")
    public WeChatConfig configData(){
        return new WeChatConfig();
    }

    @Bean
    @RefreshScope
    @ConfigurationProperties(prefix = "rw.merchant")
    public OrderConfig merchantConfig(){
        return new OrderConfig();
    }

    @Bean
    @RefreshScope
    @ConfigurationProperties(prefix = "rw.redpack")
    public RedPackConfig redPackConfig(){
        return new RedPackConfig();
    }

    @Bean
    @RefreshScope
    @ConfigurationProperties(prefix = "rw.payment")
    public PaymentResultConfig paymentResultConfig(){
        return new PaymentResultConfig();
    }

    @Bean
    @RefreshScope
    @ConfigurationProperties(prefix = "rw.cert")
    public RedPackCert redPackCert(){
        return new RedPackCert();
    }
}
